Implement Base.IndexStyle for PyObjectArray using a type argument#716
Merged
cjdoris merged 1 commit intoJuliaPy:mainfrom Nov 14, 2025
Merged
Implement Base.IndexStyle for PyObjectArray using a type argument#716cjdoris merged 1 commit intoJuliaPy:mainfrom
cjdoris merged 1 commit intoJuliaPy:mainfrom
Conversation
Contributor
Author
|
I took the liberty of removing some inserting value(d::PythonCall.NumpyDates.TimeDelta64) @ PythonCall.NumpyDates /gpfs/exfel/data/scratch/wrigleyj/julia-depot/packages/PythonCall/MxsO4/src/NumpyDates/TimeDelta64.jl:26 invalidated:
backedges: 1: superseding value(x::Dates.Period) @ Dates ~/src/julia/usr/share/julia/stdlib/v1.12/Dates/src/periods.jl:10 with MethodInstance for Dates.value(::Dates.Period) (285 children)Bringing the total number of invalidations for v1 on the future 1.12.2 release down to 340 :) |
Member
|
LGTM but can you change this to target the main branch as this isn't a breaking change. I merge main into v1 periodically. |
7766cc8 to
4c20183
Compare
Contributor
Author
|
Sure, done. |
Member
|
Oh the tests aren't running because changing the base doesn't trigger them... Can you push a trivial commit (or two commits to get back to the current state) to trigger it? It'll all get squashed away anyway. Or maybe there is a more elegant way. |
- Base already defines a IndexStyle(::AbstractArray) method for object arguments that uses the object type, so we can implement that directly and avoid the invalidations from implement Base.IndexStyle(::PyObjectArray). - The Dates stdlib already defines a method that does the same thing for any `Period`.
4c20183 to
e3e4f6a
Compare
Contributor
Author
|
I squashed them in e3e4f6a, that seems to have done the trick. |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base already defines a IndexStyle(::AbstractArray) method for object arguments that uses the object type, so we can implement that directly and avoid the invalidations from implement Base.IndexStyle(::PyObjectArray). Fixes these invalidations: